package com.gm.wholesale.module.custom.api;

import com.gm.commonlib.base.baseBean.BasePageData;
import com.gm.commonlib.base.baseBean.BaseResp;
import com.gm.commonlib.base.baseBean.DataResp;
import com.gm.wholesale.module.custom.bean.CustomBean;
import com.gm.wholesale.module.custom.bean.DefaultCustomBean;

import java.util.HashMap;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

public interface ICustomApi {
    //todo 获取全部客户，除散客外
    @GET("pda/api/v1/customer")
    Observable<BasePageData<CustomBean>> getCustomers(@QueryMap HashMap<String,Object> data);


    //todo 获取默认散客数据
    @GET("pda/api/v1/customer/default")
    Observable<DataResp<DefaultCustomBean>> getDefaultCustomers();


    //todo 删除客户
    @DELETE("pda/api/v1/customer/{id}")
    Observable<BaseResp> deleteCustomer(@Path("id") long id, @Query("version") int version);


    //创建客户
    @POST("pda/api/v1/customer")
    Observable<BaseResp> addCustorm(@Body HashMap<String,Object> data);


    //编辑客户
    @PUT("pda/api/v1/customer/{id}")
    Observable<BaseResp> updateCustorm(@Path("id") long id,@Body HashMap<String,Object> data);


    //邀请客户下单(生成参数字符串)
    @POST("pda/api/v1/customer/{customerID}/inviteOrder")
    Observable<DataResp<String>> getInviteOrder(@Path("customerID") long customerID);
}
